//舌诊api
const api = {
	usertype: '/user/wx-user/GetInfo',
	input: '/yzApi/SureInput', //提交舌诊
	faceinput: '/face/pre/taskDo', //提交面诊
	test: '/yzApi/verifyTongueImage', //验证舌像
	facetest: '/face/pre/taskPre', //验证面相
	// result:'/yzApi/resultReturn',
	wxID: '/yz/selectDetectionRecordsByWxUserId',
	szID: '/yz/selectDetectionRecordsBySzReportId',
	returnType: '/yzApi/getReturnInfo',
	answer: '/yzApi/inquiry',
	getTongueImg: '/yz/getTongueImage',
	getFaceImg: '/yz/getFaceImage',

}

//获取用户信息判断用户为普通还是服务商
export const userType = () => {
	console.log("正在验证")
	return uni.$http.get(api.usertype)

}

//验证舌象
export const Test = (tongueImage) => {
	console.log("正在验证舌像")
	return uni.$http.post(api.test, tongueImage)

}

//验证面相
export const faceTest = (faceImage) => {
	console.log("正在验证面相")
	return uni.$http.post(api.facetest, faceImage)

}


//确认提交检测
export const Input = (tongueImage) => {
	console.log("正在舌像提交")
	console.log(tongueImage)
	return uni.$http.post(api.input, tongueImage)
}

//确认提交检测
export const faceInput = (faceImage) => {
	console.log("正在面像提交")
	return uni.$http.post(api.faceinput, faceImage)
}

//回答问题接口
export const Answer = (tongueInquiryAnswerDto) => {
	console.log("正在提交")
	return uni.$http.post(api.answer, tongueInquiryAnswerDto)
}

//根据微信用户id查询舌诊报告信息
export const getReport = () => {
	return uni.$http.get(api.wxID)
}


//根据舌诊报告id查询舌诊报告详细信息
export const getszReport = (szReportId) => {
	console.log('根据舌诊报告id查询舌诊报告详细信息')
	return uni.$http.get(`${api.szID}/${szReportId}`)
}

//获取回调信息：其中returnType表示返回结果的类型
export const returnType = (szReportId, reportType) => {
	console.log("正在获取")
	return uni.$http.get(api.returnType + "/" + szReportId + "/" + reportType)
}

// 舌像辨识获取上传舌像
export const getTongueImg = (outId) => {
	console.log("正在获取上传舌像")
	return uni.$http.get(`${api.getTongueImg}/${outId}`)
}

// 舌像辨识获取上传面相
export const getFaceImg = (outId) => {
	console.log("正在获取上传面相")
	return uni.$http.get(`${api.getFaceImg}/${outId}`)
}